<?php
class DB extends mysqli
{

    public function __construct($host = 'openserver', $user = 'root', $pass = '', $db = 'desert')
    {
        parent::__construct($host, $user, $pass, $db);

        if (mysqli_connect_error())
        {
            die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
        }
    }
    

    public function __destruct()
    {
        $this->close();
    }

}
?>